package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.service.IEmployeeService;
import cn.wolfcode.crm.util.PermissionName;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {


    @RequestMapping("index")
    public String index(){
        return "index";
    }



    @Autowired
    private IEmployeeService employeeService;

    @RequestMapping("/editPassword")
    @PermissionName("修改密码")
    @RequiresPermissions("employee:editPassword")
    @ResponseBody
    public String editPassword(String password) {
        employeeService.updatePasswordById(password);
        return password;
    }

}
